package com.heima.article.job;

import com.heima.article.service.HotArticleService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import sun.rmi.runtime.Log;

/**
 * @作者 itcast
 * @创建日期 2021/4/26 14:06
 **/
@Component
@Slf4j
public class ComputeHotArticleJob {
    @Autowired
    HotArticleService hotArticleService;
    @XxlJob("computeHotArticleJob")
    public ReturnT hotArticleJob(String params){
        log.info("热点文章计算定时任务触发，缓存近5天 热点文章数据到redis==============");
        hotArticleService.computeHotArticle();
        log.info("热点文章计算定时任务执行完毕");
        return ReturnT.SUCCESS;
    }
}
